package com.school.fuyuan.business.model.vo;

import com.school.fuyuan.business.constants.InfoConstants;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author zrhong
 * @version 1.0
 * @date 2019/3/22 23:08
 * @description
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class AddUserVo implements Serializable {
    @Pattern(regexp = InfoConstants.SINGLE_MOBILE, message = "请输入正确的电话号码格式")
    @NotBlank(message = "手机号不能为空")
    private String mobile;  //手机号

    @NotBlank(message = "密码不能为空")
    @Length(min = 6,max = 10,message = "密码长度6-10")
    private String password;  //手机号

    @Length(max = 255,message = "用户名超长")
    @NotBlank(message = "用户名不能为空")
    private String userName;    //用户姓名

    @Email(message = "请输入正确的邮箱地址")
    @NotBlank(message = "邮箱地址不能为空")
    private String email;   //邮箱

    private String position;    //职位

    @NotBlank(message = "角色不能为空")
    private String roleId;
}
